import { Directive, HostBinding, Input } from '@angular/core';



@Directive({
  selector: '[dynamic-content]' // Attribute selector
})
export class DynamicContentDirective {
  @Input() style:any;
  constructor() {
    console.log('Hello DynamicContentDirective Directive');
  }

  @HostBinding('style.background-image')
  get getBackgroundImage() {
    
    console.log(this.style);
    if (this.style) {
      return this.style.backgroundImage;
    }
  }

  @HostBinding('style.background-repeat')
  get getBackgroundRepeat() {
    if (this.style) {
      return "no-repeat";
    }
  }

  @HostBinding('style.background-size')
  get getBackgroundSize() {
    if (this.style) {
      return "cover";
    }
  }

  @HostBinding('style.color')
  get getTextColor() {
    if (this.style) {
      return this.style.textColor;
    }
  }
}
